package org.example.newcoder_summer.Mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.newcoder_summer.pojo.User;

@Mapper
public interface UserMapper {
    @Select("SELECT * FROM user WHERE id = #{id}")
    User getUser(int id);

    @Select("SELECT * FROM user WHERE account = #{account} and password = #{password}")
    User getByUserNameAndPassword(User user);

    @Insert("insert into user(identity, gender, account, password, user_name, phone_number, level, register_time, update_time)" +
            "values(#{identity}, #{gender}, #{account}, #{password}, #{userName}, #{phoneNumber}, #{level}, #{registerTime}, #{updateTime})")
    void setUser(User user);
}
